<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp"%>
<%@ page import="com.chanyachting.emall.util.*" %>
<%@ page import="java.util.*" %>

<%@ page import="com.chanyachting.emall.domain.*" %>
<%@ page import="com.chanyachting.emall.util.RequestUtil" %>
<%@ page import="com.chanyachting.emall.service.*" %>
<%@ page import="com.chanyachting.emall.serviceImpl.*" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="" /> 
<meta name="description" content="" />
<link href="css/import.css" type="text/css" rel="stylesheet" />
<title>修改公司信息</title>
<style type="text/css">
<!--
.STYLE1 {font-weight: bold}
-->
</style>

	 <link type="text/css" href="<%=root%>/js/jqueryUI/css/ui.base.css" rel="stylesheet" />
	 <link type="text/css" href="<%=root%>/js/jqueryUI/css/ui.theme.css" rel="stylesheet" />
	 <link type="text/css" href="<%=root%>/js/jqueryUI/css/demos.css" rel="stylesheet" />
	 
<script type="text/javascript" src="<%=root %>/js/jquery-1.3.2.min.js" charset="utf-8">//ADCRM</script>
<script type="text/javascript" src="<%=root %>/js/jquery.form.js" charset="utf-8">//ADCRM</script>

	<script type="text/javascript" src="<%=root%>/js/jqueryUI/ui/ui.core.js"></script>
	<script type="text/javascript" src="<%=root%>/js/jqueryUI/ui/ui.datepicker.js"></script>
	
	<script type="text/javascript" src="<%=root%>/js/jqueryUI/ui/ui.draggable.js"></script>
	<script type="text/javascript" src="<%=root%>/js/jqueryUI/ui/ui.resizable.js"></script>
	<script type="text/javascript" src="<%=root%>/js/jqueryUI/ui/ui.dialog.js"></script>
	



<script type="text/javascript" src="<%=root %>/js/arealink.js" charset="utf-8">//ADCRM</script>


<script language="javascript" type="text/javascript">

	$(function(){
	
		$.ajaxSetup ({
		    cache: false //关闭AJAX相应的缓存
		});
	
		$("#date1").datepicker();
		
	});


	function changeBusinessType(id){

		if(id!=0){
		
			//alert("btypeId:"+id);

			$.get("inc/businessCategoryList.jsp", { btypeId: id },
					  function(data){
					    //alert("Data Loaded: " + data);
					    $("#businessCategory").html(data);
					  });
		}
	
	}


	//添加企业黄页关键字
	function addCompanykeyword(productCategoryId){


	}


	//删除企业黄页关键字
	function delCompanykeyword(productCategoryId){


	}

</script>

</head>

<%

	//从session中获得公司对象
	RequestUtil ru=new RequestUtil(request);
	
	Company company=(Company)ru.getSessionObject(CompanyService.COMPANY_IN_SESSION,new Company());
	
%>

<body>
<div class="tab_box">
	<div class="tab_menu">
        <a href="company_info_update.jsp" class="current">公司信息修改</a>
        <a href="company_yellowpage_update.jsp">管理企业黄页</a>
    </div>
	<div class="tab_submenu">
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="50%">&nbsp;</td>
          <td align="right"><strong><a href="#">预览</a><a href="#">打印</a><a href="#">导出</a></strong></td>
        </tr>
      </table>
	</div>
</div>


<div><%= new RequestUtil(request).getMsg() %></div>

<form action="<%=root %>/memberBackend/companyUpdate.do" method="post" name="form3" id="form3" enctype="multipart/form-data">

<input type="hidden" name="id" value="<%= company.getId()==null?"0":company.getId() %>" />
<input type="hidden" name="createDate" value="<%= company.getCreateDate() %>" />

<input type="hidden" name="logoUrl" value="<%= company.getLogoUrl() %>" />
<input type="hidden" name="logoUrl2" value="<%= company.getLogoUrl2() %>" />
<input type="hidden" name="yellowPageImgUrl" value="<%= company.getYellowPageImgUrl() %>" />


  <div id="bigbox">
 
    <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="360" valign="top">
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
              <td  height="25" align="right"><span class="red">*</span>公司名称：</td>
              <td><label>
                <input type="text" name="name" id="textfield2" value="<%= company.getName() %>"/>
              </label></td>
            </tr>
            <tr>
              <td height="25" align="right"><span class="red">*</span>地址：</td>
              <td width="250"><label>
                <select name="firstAddress" id="s1">
				<option></option>
				</select> 
				
				<select name="secondAddress" id="s2">
				<option></option>
				</select>
               
              </label></td>
            </tr>
            
            <tr>
              <td height="25" align="right"><span class="red">*</span>详细地址：</td>
              <td><label>
                <input type="text" name="detailAddress" id="textfield14" value="<%= company.getDetailAddress() %>"/>
              </label></td>
            </tr>
            
            <tr>
              <td height="25" align="right"><span class="red">*</span>街道：</td>
              <td><label>
                <input type="text" name="streetName" id="textfield14" value="<%= company.getStreetName() %>"/>
              </label></td>
            </tr>
            <tr>
              <td height="25" align="right"><span class="red">*</span>邮编：</td>
              <td><label>
                <input name="postcode" type="text" id="textfield7"  value="<%= company.getPostcode() %>"/>
              </label></td>
            </tr>
            <tr>
              <td height="25" align="right"><span class="red">*</span>电话：</td>
              <td><label>
                <input type="text" name="tel" id="textfield8" value="<%= company.getTel() %>"/>
              </label></td>
            </tr>
            <tr>
              <td height="25" align="right"><span class="red">*</span>传真：</td>
              <td><label>
                <input type="text" name="fax" id="textfield11" value="<%= company.getFax() %>"/>
              </label></td>
            </tr>
            <tr>
              <td height="25" align="right"><span class="red">*</span>联系人：</td>
              <td><label>
                <input type="text" name="linkManName" id="textfield18" value="<%= company.getLinkManName() %>"/>
              </label></td>
            </tr>
            <tr>
              <td height="25" align="right">联系人手机：</td>
              <td><input name="linkManPhone" type="text" id="textfield16" size="11" value="<%= company.getLinkManPhone() %>"/>
                  <label></label></td>
            </tr>
            <tr>
              <td height="25" align="right">在线联系方式：</td>
              <td><label>
                <input name="linkManWeb" type="text" id="textfield14" size="11" value="<%= company.getLinkManWeb() %>"/>
              </label></td>
            </tr>
            <tr>
              <td height="25" align="right"><span class="red">*</span>联系人Email：</td>
              <td><label>
                <input type="text" name="linkManEmail" id="textfield15" value="<%= company.getLinkManEmail() %>"/>
              </label></td>
            </tr>
            <tr>
              <td height="25" align="right"><span class="red">*</span>公司网站：</td>
              <td><label>
                <input type="text" name="webPage" id="textfield16" value="<%= company.getWebPage() %>"/>
              </label></td>
            </tr>
        </table></td>
        <td valign="top">
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td height="28" colspan="2" align="center"><img src="<%=company.getLogoUrl() %>" width="200" height="120" /></td>
              </tr>
              <tr>
                <td width="100" height="28" align="right">公司LOGO：</td>
                <td><input type="file" name="logoFile" id="fileField3" /></td>
              </tr>
              <tr>
                <td height="28" align="right">公司营业执照：</td>
                <td><label>
                  <input type="file" name="logoFile2" id="fileField" />
                </label></td>
              </tr>
              <tr>
                <td height="28" align="right">联系人职务：</td>
                <td><label>
                <input type="text" name="linkManJob" id="textfield17" value="<%= company.getLinkManJob() %>"/>
                </label></td>
              </tr>
              <tr>
                <td height="28" align="right">服务产品：</td>
                <td><label>
                <input type="text" name="mainServiceProduct" id="textfield18" value="<%= company.getMainServiceProduct() %>"/>
                </label></td>
              </tr>
              <tr>
                <td height="28" align="right">服务区域 ：</td>
                <td><label>
                <input type="text" name="mainServiceArea" id="textfield19" value="<%= company.getMainServiceArea() %>"/>
                </label></td>
              </tr>
        </table></td>
      </tr>
    </table>
    <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="100" height="28" align="right" class="td_bottom STYLE1"><span class="red">*</span>企业详细介绍</td>
        <td class="td_bottom">&nbsp;</td>
      </tr>
    </table>
    <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="100" valign="top">&nbsp;</td>
        <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td height="28"><span class="red">*</span>公司性质：</td>
              <td><label>
                <select name="companyType" id="select7">
                	<%
                		Iterator comptypeIt=CodeMap.companyType.keySet().iterator();
                	
                		while(comptypeIt.hasNext()){
                			
                			String key=comptypeIt.next().toString();
                			
                			String value=CodeMap.companyType.get(key).toString();
                			
                			if(company.getCompanyType()==null) company.setCompanyType("00");
                	%>
                		<option value="<%=key %>" <%= company.getCompanyType().equals(key)?"selected":"" %>><%=value %></option>
                	<%
                			
                		}
                	%>
                </select>
              </label></td>
            </tr>
            <tr>
              <td height="28"><span class="red">*</span>公司雇员：</td>
              <td><label>
                <select name="employeeNumber" id="select8">
                	<%
                		Iterator employeeNumberIt=CodeMap.employeeNumber.keySet().iterator();
                	
                		while(employeeNumberIt.hasNext()){
                			
                			String key=employeeNumberIt.next().toString();
                			
                			String value=CodeMap.employeeNumber.get(key).toString();
                			
                			if(company.getEmployeeNumber()==null) company.setEmployeeNumber("00");
                	%>
                		<option value="<%=key %>" <%= company.getEmployeeNumber().equals(key)?"selected":"" %>><%=value %></option>
                	<%
                			
                		}
                	%>
                </select>
              </label></td>
            </tr>
            <tr>
              <td height="28"><span class="red">*</span>成立时间：</td>
              <td><label>
              <input type="text" name="companyCreateDate" id="date1" size="10"  maxlength="10" value="<%= company.getCompanyCreateDate() %>"/>
              </label></td>
            </tr>
            <tr>
              <td height="28"><span class="red">*</span>国家：</td>
              <td><label>
                <select name="companyState" id="select9">
                	<%
                		Iterator stateIt=CodeMap.state.keySet().iterator();
                	
                		while(stateIt.hasNext()){
                			
                			String key=stateIt.next().toString();
                			
                			String value=CodeMap.state.get(key).toString();
                	%>
                		<option value="<%=key %>"><%=value %></option>
                	<%
                			
                		}
                	%>
                </select>
              </label></td>
            </tr>
            <tr>
              <td height="28">地理位置坐标：</td>
              <td><label>
                <input name="coordinate" type="text" id="fileField6" size="50" value="<%= company.getCoordinate() %>"/>
              </label></td>
            </tr>
            <tr>
              <td height="28">进口额：</td>
              <td><label>
                <input type="text" name="importTurnover" id="textfield23" value="<%= company.getImportTurnover() %>"/>
              </label></td>
            </tr>
            <tr>
              <td height="28">营业额</td>
              <td><label>
                <input type="text" name=turnover id="textfield28" value="<%= company.getTurnover() %>" />
              </label></td>
            </tr>
        </table></td>
      </tr>
    </table>
    <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td width="100" height="28" align="right"> <label>公司简介</label> </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td height="160">&nbsp;</td>
        <td valign="bottom"><p>
            <label>
            <textarea name="companySummary" id="textarea4" cols="92" rows="9"><%= company.getCompanySummary() %></textarea>
            </label>
        </p></td>
      </tr>
    </table>
    <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">

      <tr>
        <td height="28" align="right">行业性质：</td>
        <td><label>
        <select name="businessTypeId" id="businessType" onchange="changeBusinessType(this.value);">
        	<option value="0">请选择</option>
        <%
        	//获得所有行业类型
        	List btypeList=Businesstype.list();
        
        	if(btypeList!=null && btypeList.size()>0){
        		
        		Businesstype btype=null;
        		
        		for(int i=0;i<btypeList.size();i++){
        			
        			btype=(Businesstype)btypeList.get(i);
        %>
        	<option value="<%=btype.getId() %>"><%=btype.getName() %></option>
        <%
        			
        		}
        	}
        
        %>
          </select>
        </label></td>
      </tr>
      <tr>
        <td width="100" height="126">&nbsp;</td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="28">行业次分类</td>
            <td>&nbsp;</td>
            <td>主营产品服务</td>
            <td>&nbsp;</td>
            <td>关键词选择</td>
          </tr>
          <tr>
            <td id="businessCategory"><label>
              <textarea name="businessCategoryId" id="textarea2" cols="20" rows="5"></textarea>
            </label>
            </td>
            <td> -- > </td>
            <td id="productCategory"><label>
              <textarea name="textarea2" id="textarea8" cols="20" rows="5"></textarea>
            </label></td>
            <td> <input type="button" value="添加" onclick="alert(document.getElementById('productcategoryId').value);"/><br /> 
            	<input type="button" value="删除" /></td>
            <td><label>
              <textarea name="textarea2" id="textarea9" cols="20" rows="5"></textarea>
            </label></td>
          </tr>
        </table></td>
      </tr>
    </table>
    <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
     
      
       <tr>
        <td width="100" height="28" align="right" class="td_bottom STYLE1"><span class="red">*</span>企业黄页介绍</td>
        <td class="td_bottom">&nbsp;</td>
      </tr>
      
      <tr>
        <td height="130">&nbsp;</td>
        <td valign="bottom"><p>&nbsp; </p>
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="49%"><label>
                  <textarea name="yellowPageSummary" id="textarea" cols="50" rows="7"><%= company.getYellowPageSummary() %></textarea>
                </label></td>
                <td width="51%"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                    <tr>
                      <td width="80" align="right">&nbsp;</td>
                      <td width="173"><img src="<%= company.getYellowPageImgUrl() %>" width="128" height="86" /></td>
                    </tr>
                    <tr>
                      <td height="28" align="right">上传/修改：</td>
                      <td><label>
                        <input type="file" name="yellowPageFile" id="fileField2" />
                      </label></td>
                    </tr>
                </table></td>
              </tr>
            </table>
          <p>
              <label></label>
          </p></td>
      </tr>
    </table>
    <table width="700" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td align="center" class="td_bottom">&nbsp;</td>
      </tr>
      <tr>
        <td height="60" align="center"><label>
          <input type="submit" name="button2" id="button2" value="确认" />
          <input type="reset" name="button5" id="button5" value="取消" />
        </label></td>
      </tr>
    </table>
  </div>
</form>
<p>&nbsp;</p>
</body>

<script language="javascript"> 
areaSetup();
</script>
</html>
